<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>  
    <script type="text/javascript">
	function addUser() {
	var contactTelField = document.getElementById("telphone");
		if ((contactTelField.value) != "") {
			
			for (var i=0; i<contactTelField.value.length; i++) {
				var c = contactTelField.value.charAt(i);
				if (!(c >= '0' && c <= '9')) {
					alert("电话号码不合法！");
					contactTelField.focus();
					return false;
				}
			}
		}
	
				//密码至少6位
		if (document.getElementById("password").value.length < 6) {
			alert("餐馆密码至少6位！,当前为"+document.getElementById("password").value.length);
			document.getElementById("password").focus();
			return false;
		}
		//餐馆地址不为空
		if (document.getElementById("address").value=="") {
			alert("地址不为空");
			document.getElementById("address").focus();
			return false;
		}
		//餐馆收入只能是数字
	
		if ((document.getElementById("sale").value) != "") {
			
			for (var i=0; i<document.getElementById("sale").value.length; i++) {
				var c = document.getElementById("sale").value.charAt(i);
				if (!(c >= '0' && c <= '9')) {
					alert("餐馆收入不合法，必须为数字！");
					document.getElementById("sale").focus();
					return false;
				}
			}
	}
	//餐馆介绍不能为空
	if (document.getElementById("remark").value=="") {
			alert("餐馆介绍不为空");
			document.getElementById("remark").focus();
			return false;
		}
			
}
</script>
  <link rel="stylesheet" type="text/css" href="css/li.css">
  
 </head>
  
<body bgcolor="#FFCCFF">
<% 
String Rest_Id =request.getParameter("RestId");
String Dish_Style_Id =request.getParameter("id"); 
String Rest_Password = request.getParameter("password"); 
String Rest_Name = request.getParameter("userName"); 
String Rest_Telphone =request.getParameter("telphone"); 
String Rest_Address =request.getParameter("address"); 
String Sales_Turnover=request.getParameter("sale"); 
String Remark =request.getParameter("remark"); 
 %>
<center>
<form action="OperatorModify2" method="post" onSubmit="return addUser()">
<table width="240" border="0">
 <tr>
 <td>餐馆ID</td>
 <td><input type="text" name="RestId" value=<%=Rest_Id %> readonly></td>
 </tr>
  <tr>
    <td class="li">餐馆名称：</td>
    <td><input name="userName" type="text" id="userName" value=<%=Rest_Name%> readonly></br><span id="spanUserId"></span></td>
  </tr>
  <tr>
    <td nowrap="nowrap" class="li">餐馆密码：</td>
    <td><input type="password" name="password" value=<%=Rest_Password %> ></td>
  </tr>
  <tr>
    <td class="li">餐馆电话</td>
    <td><input type="text" name="telphone" value=<%=Rest_Telphone%> ></td>
  </tr>
  <tr>
    <td class="li">餐馆地址：</td>
    <td><input type="text" name="address" value=<%=Rest_Address%> ></td>
  </tr>
  <tr>
    <td class="li">餐馆收入：</td>
    <td><input type="text" name="sale" value=<%=Sales_Turnover%> ></td>
  </tr>
  <tr>
    <td class="li">餐馆介绍：</td>
    <td><input type="text" name="remark" value=<%=Remark%> ></td>
  </tr>
  <tr>
     <td class="li">菜系ID</td>
    <td><input type="text" value=<%=Dish_Style_Id %> ></td>
    </tr>
    <tr>
    <td class="li">更新&nbsp;&nbsp;ID</td>
    <td><select name="id" > >
  <option value="1">1</option>
  <option value="2">2</option>
   <option value="3">3</option>
   <option value="4">4</option>
   <option value="5">5</option>
   <option value="6">6</option>
   <option value="7">7</option>
   <option value="8">8</option>  
  </select></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>  <input type="submit" value="修改" onClick="addUser()"></td>
  </tr>
</table>
<font size="+1" color=""></font>
</form>
</center>
</html>
